package com.geeaks.learn.filter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class StreamTest {
	
	public static void main(String[] args) {
		List<Integer> nums = Arrays.asList(1, 2, 3, 4);
		List<Integer> squareNums = nums.stream().map(n -> calc(n)).collect(Collectors.toList());
		squareNums.stream().forEach(s -> System.out.println(s));
	}
	
	public static int calc(int n) {
		return n*n*n-n;
	}
}
